Caption = "Searching with FindFirst method on a whole string or partial string"
ClientHeight = 4020
ClientLeft = 1095
ClientTop = 1500
ClientWidth = 7365
Height = 4425
Left = 1035
LinkTopic = "Form1"
ScaleHeight = 4020
ScaleWidth = 7365
Top = 1155
Width = 7485
Begin CommandButton Command2
Caption = "Push to Clear list"
Height = 495
Left = 360
TabIndex = 7
Top = 3120
Width = 1695
End
Begin Frame Frame1
Height = 1935
Left = 2760
TabIndex = 3
Top = 240
Width = 2415
Begin OptionButton Option2
Caption = "Partial title"
Height = 495
Left = 240
TabIndex = 5
Top = 1080
Value = -1 'True
Width = 2055
End
Begin OptionButton Option1
Caption = "Whole title"
Height = 495
Left = 240
TabIndex = 4
Top = 360
Width = 2055
End
End
Begin ListBox List1
Height = 1200
Left = 2400
TabIndex = 2
Top = 2520
Width = 4695
End
Begin TextBox Text1
Height = 495
Left = 5520
TabIndex = 0
Top = 1080
Width = 1455
End
Begin CommandButton Command1
Caption = "Push to Find"
Height = 495
Left = 5520
TabIndex = 1
Top = 1800
Width = 1455
End
Begin Label Label3
Caption = "Enter string below to search on:"
Height = 615
Left = 5520
TabIndex = 9
Top = 360
Width = 1455
End
Begin Label Label2
Caption = "Select an option of how you want to search for a title(ie Search on the 'Whole title' or search on the 'Partial title' or first letter or of the title)."
Height = 1455
Left = 360
TabIndex = 8
Top = 360
Width = 2175
End
Begin Label Label1
Caption = "Results of Search ---->"
Height = 375
Left = 240
TabIndex = 6
Top = 2520
Width = 2055
End
End
Dim a$
Dim c$
Sub Command1_Click ()
Dim db As database
Dim ds As dynaset
Set db = OpenDatabase("C:\vb\biblio.mdb")
Set ds = db.CreateDynaset("titles")
If option2.Value = True Then
a$ = Trim$(text1.Text) + "*" '*** or
c$ = "[title] like '" & a$ & "'"
ElseIf option1.Value = True Then
a$ = Trim$(text1.Text) '*** if this one, use '=' and not 'like' below